package com.hxexp.weixin.test;

import org.apache.commons.codec.DecoderException;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.MethodSorters;

import com.hxexp.weixin.common.zip.ZipUtils;

/**
 * @author li.jiang
 *
 */
@RunWith(BlockJUnit4ClassRunner.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ZipUtilsTester {
    @Test
    public void test() throws DecoderException {
        String str = "http://weixin.huaxiaexpress.com.cn/weixin/trafficline/index.do?ver=lz&starting=泸州客运中心站&startStationId=646000001&startStationsDisabled=1";
        String zipStr = ZipUtils.zip(str);
        String gzipStr = ZipUtils.gzip(str);

        System.out.println("gzip str:" + gzipStr);
        System.out.println("zip str:" + zipStr);
        System.out.println("ungzip str:" + ZipUtils.ungzip(gzipStr));
        System.out.println("unzip str:" + ZipUtils.unzip(zipStr));
    }
}
